<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <div class="test"></div>
    <div class="getone"></div>
</div>
<script>
    var getAge = function(n){
        if(n==1) {
            return 10;
        }else{
            return getAge(n-1)+2;
        }
    }
    $(".test").html(getAge(4));

    var getMax = function(n){
        var ns = 5;
        if(n == 1){
            return 1/5;
        }
        else{
            return getMax(n-1) + n/5;
        }
    }
    $(".getone").html(getMax(5));

  var a = function(n){
    if(n>1){
      return n*a(n-1);
    }else{
      return 1;
    }
  }

  var delRepeat = function(arr){
    var arrNew = [];
    for(var i in arr){
      if(arrNew.indexOf(arr[i]) == -1){
        arrNew.push(arr[i]);
      }
    }
    return arrNew;
  }
</script>
</body>
</html>